package sort

import "Code/utils"

// MergeSort 归并排序
func MergeSort(arr []int) []int {
	var length int
	if length = len(arr); length <= 1 {
		return arr
	}

	mid := length >> 1

	return utils.MergeOrderArr(MergeSort(arr[0:mid]), MergeSort(arr[mid:length]))
}
